3.1.17 \(\int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx\) [17]

Optimal. Leaf size=25 \[ -\frac {a \cot (c+d x)}{d}+\frac {b \log (\tan (c+d x))}{d} \]

[Out]

-a*cot(d*x+c)/d+b*ln(tan(d*x+c))/d

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {45} \begin {gather*} \frac {b \log (\tan (c+d x))}{d}-\frac {a \cot (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]^2*(a + b*Tan[c + d*x]),x]

[Out]

-((a*Cot[c + d*x])/d) + (b*Log[Tan[c + d*x]])/d

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin {align*} \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx &=\frac {\text {Subst}\left (\int \frac {a+b x}{x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {a}{x^2}+\frac {b}{x}\right ) \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {a \cot (c+d x)}{d}+\frac {b \log (\tan (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 36, normalized size = 1.44 \begin {gather*} -\frac {a \cot (c+d x)}{d}-\frac {b (\log (\cos (c+d x))-\log (\sin (c+d x)))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]^2*(a + b*Tan[c + d*x]),x]

[Out]

-((a*Cot[c + d*x])/d) - (b*(Log[Cos[c + d*x]] - Log[Sin[c + d*x]]))/d

________________________________________________________________________________________

Maple [A]
time = 0.26, size = 24, normalized size = 0.96

method result size
derivativedivides \(\frac {-\cot \left (d x +c \right ) a +b \ln \left (\tan \left (d x +c \right )\right )}{d}\) \(24\)
default \(\frac {-\cot \left (d x +c \right ) a +b \ln \left (\tan \left (d x +c \right )\right )}{d}\) \(24\)
risch \(-\frac {2 i a}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(57\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)^2*(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-cot(d*x+c)*a+b*ln(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 25, normalized size = 1.00 \begin {gather*} \frac {b \log \left (\tan \left (d x + c\right )\right ) - \frac {a}{\tan \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

(b*log(tan(d*x + c)) - a/tan(d*x + c))/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 62 vs. \(2 (25) = 50\).
time = 0.35, size = 62, normalized size = 2.48 \begin {gather*} -\frac {b \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - b \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) + 2 \, a \cos \left (d x + c\right )}{2 \, d \sin \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(b*log(cos(d*x + c)^2)*sin(d*x + c) - b*log(-1/4*cos(d*x + c)^2 + 1/4)*sin(d*x + c) + 2*a*cos(d*x + c))/(
d*sin(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan {\left (c + d x \right )}\right ) \csc ^{2}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)**2*(a+b*tan(d*x+c)),x)

[Out]

Integral((a + b*tan(c + d*x))*csc(c + d*x)**2, x)

________________________________________________________________________________________

Giac [A]
time = 0.48, size = 35, normalized size = 1.40 \begin {gather*} \frac {b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) - \frac {b \tan \left (d x + c\right ) + a}{\tan \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

(b*log(abs(tan(d*x + c))) - (b*tan(d*x + c) + a)/tan(d*x + c))/d

________________________________________________________________________________________

Mupad [B]
time = 3.63, size = 25, normalized size = 1.00 \begin {gather*} \frac {b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {a\,\mathrm {cot}\left (c+d\,x\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x))/sin(c + d*x)^2,x)

[Out]

(b*log(tan(c + d*x)))/d - (a*cot(c + d*x))/d

________________________________________________________________________________________